package com.jz.netthings.application.sample.mapper;

import com.jz.netthings.application.sample.bean.AssayPrintSupport;
import com.jz.netthings.application.sample.bean.AssayResultPrintSupport;
import com.jz.netthings.application.sample.bean.PlasmaSamples;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.netthings.application.sample.bean.XhdbSupport;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lzf
 * @since 2019-03-12
 */
public interface PlasmaSamplesMapper extends BaseMapper<PlasmaSamples> {

    @Select("SELECT MAX(sampleNo) FROM plasma_samples WHERE sampleNo LIKE '${theDay}%'")
    String getMaxSampleOnDay(@Param("theDay")String theDay);

    String getCodeData(@Param("type") String type,@Param("id") String id);
    List<PlasmaSamples> selectBySample(PlasmaSamples gCheck);


    List<PlasmaSamples> selectByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
    List<PlasmaSamples> selectCurrentDaysByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize ,@Param("currentDate")String currentDate);
    Integer queryCurrentDaysCount(@Param("currentDate")String currentDate);
    Integer queryCount();

    /**
     * 查询血红蛋白含量
     * @param date 格式：yyyyMMdd
     * @return
     */
    List<XhdbSupport> selectXhdbByAssayDate(@Param("date")String date);

    /**
     * 查询血红蛋白含量的各种数量
     * @param date 格式：yyyyMMdd
     * @return
     */
    AssayPrintSupport selectXhdbCountByAssayDate(@Param("date")String date);


    List<AssayResultPrintSupport> selectAssayResultList(@Param("date")String assayDate);

}
